home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 9
/
The PC-SIG Library on CD ROM - Ninth Edition.iso
/
1201_300
/
DISK1206
/
DISK1206.ZIP
/
BOYAN40A.ARC
/
HOST.BSC
< prev
next >
Wrap
Text File
|
1989-02-01
|
13KB
|
271 lines
\\ BOYAN HOST MODE Version 4.0.
\\ Script files: HOST.BSC, HOSTMSGS.BSC
\\ Customizable Host Mode script providing:
\\ * 2 levels of password protection
\\ * Welcome bulletin file "WELCOME.MSG"
\\ * Named message entry into files with .MSG suffix. Auto-line numbering.
\\ * Usage log lists names and on-line times of all host callers
\\ * Message functions: list all messages, read or delete a message.
\\ * File uploads and downloads using any BOYAN protocol, Zmodem, Kermit
\\ * Remote Shell to DOS, Host Mode shutdown
\\
\\ The following 4 variables are set automatically by the HOST Action Module.
\\ Use Configuration Area "A", Action Module "HOST" to change those settings.
\\ %V1 = Host Password
\\ %V2 = Secondary Password, for DOS Shells and other "System" commands
\\ %V3 = MODEM if connection is over a modem,
\\ DIRECT if connection is direct,
\\ LOCAL if we're doing a local host mode test.
\\ %V4 = The host disk directory (used for messages and file transfers)
\\ When a caller is online, %V6 holds the caller's name.
\\ Note the use of the "\(" shortcut to cycle the host if carrier drops.
|InitHost
\IE-%AN,HOST[\AM[H]] \\ load HOST module if not yet loaded.
\IE-%AN,HOST[\DM[Unable to load HOST module.]\AB] \\ abort if can't load BAM
\ZS\ST[Invoking host mode...] \\ zap screen, status message
\DM1[-------- BOYAN Host 4.0 --------] \\ display message
\DM2[ Initializing... ]
\CP[None] \\ use No parity in host mode
\BB- \\ turn off Beeps & Bells
\KO[0] \\ script keyboard timeout = 0 seconds
\SP[0]\SL[0] \\ set char pacing and line pacing to 0
\UM[HOST MODE INVOKED] \\ add usage message to BOYAN.USE
\MV5[12] \\ Save "After Script" macro #12 in %V5.
\SV6[] \\ %V6 will be used later for username
\SM12[\SC"[HOST;Reset"]] \\ After script finishes, run Reset block
\MV7[119] \\ Save current Shortcut macro \( in %V7.
\SM119[\IV3+MODEM"[\CA-"[\GS"[HOST;Cycle"]"]"]] \\ sets Shortcut macro \(
\\ Now, \( will automatically cycle the host if the carrier signal is lost.
\IV3-MODEM[\GB[Welcome]] \\ Go straight to welcome if not MODEM.
\GB[WaitForCall] \\ Wait for a call
|WaitForCall
\EC-\LF- \\ turn Echo & LF's off
\CA+[\GB[Welcome]] \\ if already connected, welcome caller!
ATX4S0=0{ \\ Tell modem not to auto-answer
\WF[OK]~~ \\ expect "OK" message from modem
\DM1[-------- BOYAN Host 4.0 --------]
\DM2[ Waiting for RING... ]
\DM3[ Press <Esc> to quit Host Mode. ]
\TO[255] \\ This means to wait forever...
\WF[RING] \\ ... for the first "RING" message.
\TO[7] \\ wait 7 secs for each add'l ring
\RE`0`[\WF[RING]\IW-[\GB[WaitForCall]]] \\ Wait for `0` more rings;
\\ If not enough RING's, go back to top.
~ATA{ \\ Tell modem to establish connection
\TO[30]\WF[CONNECT] \\ Wait 30 seconds for "CONNECT"
\IW-[\GB[Cycle]]~ \\ If no connect, go cycle now. Else:
\\(Add "\\" before next five lines if you have your comm port fixed at 19200)
\IF+96[\CS[9600]\GB[Welcome]] \\ ... Change our speed parameter
\IF+48[\CS[4800]\GB[Welcome]] \\ to match the number given in the
\IF+24[\CS[2400]\GB[Welcome]] \\ modem's connect message...
\IF+12[\CS[1200]\GB[Welcome]] \\ [Then go to the "Welcome" block.]
\CS[300] \\ ...or 300 baud if just "CONNECT"
\GB[Welcome] \\
|Welcome
\IE-%AN,HOST[\AM[H]] \\ make sure we're using Host module
\DM1[-------- BOYAN Host 4.0 --------]
\DM2[ Host mode activated! ]
\DM3[ Connection type: %V3 ]
\EC+\LF+ \\ Echo & LF's on while host active..
\IV3+MODEM[\PA[6]] \\ if MODEM connection pause 6 seconds
{{{
Welcome to BOYAN 4.0 Host!{{
\PL \\ purge line of incoming characters
Press <Enter> to begin: `
\TO[40]\RV0[0] \\ give user 40 seconds to respond
\IW-[\GB[LogOff]] \\ if no response, log user off!
\( \\ Shortcut: cycle host if carrier lost
{{Enter your first and last name: ` \\ prompt for user's name
\RV6[50]\( \\ Reads up to 50 chars into %V6
\UM[| Host username: %V6] \\ add Usage Message to BOYAN.USE
\BL[GetPassword]\( \\ sets %V0 = what they type in.
\IE-%V0,%V1[\BL[GetPassword]\(] \\ If incorrect, give second chance.
\IE-%V0,%V1[\BL[GetPassword]\(] \\ Still wrong? Third and final chance!
\IE-%V0,%V1[\GB[WrongPassword]\(] \\ If password still wrong, log user off.
{ \\ If "WELCOME.MSG" file exists in host
\FE+%V4welcome.msg[\ULa[%V4welcome.msg]] \\ directory, then send it.
\GB[Menu] \\ Then continue to the Main Menu.
|GetPassword
{Enter the password: ` \\ prompt for pw
\RV0[15] \\ Reads up to 15 chars from user
|Menu
{
BOYAN-Host select ([M]essages, [F]iles, [J]ump-DOS, [G]oodbye): `
\RV0[1]\( \\ Read 1 char into %V0
\IV0+M[\GS[HOSTMSGS;Messages]] \\ If "M" invoke HOSTMSGS script
\IV0+F[\GB[Files]] \\ If "F" go to "Files" block
\IV0+J[\GB[Shell]] \\ If "J" go to "Shell" block
\IV0+G[\GB[Goodbye]] \\ If "G" go to "Goodbye" block
\GB[Menu] \\ otherwise loop back to Menu.
|Files \\ Files sub-menu
{
Files Select ([L]ist, [D]ownload, [U]pload, [Q]uit): \RV0[1]\(
\IV0+Q[\GB[Menu]] \\ if Q, quit back to main menu
\IV0+L[\GB[ListFiles]]
\IV0+D[\GB[Download]]
\IV0+U[\GB[Upload]]
\GB[Files] \\ if not L,D,or U, go back and re-ask.
|ListFiles \\ list files in host directory
{
Files available for downloading:{
\DC[dir %V4 > %V4`hosttemp.fil] \\ use DOS to create list in temp. file
\ULa[%V4`hosttemp.fil] \\ then ASCII-upload that file.
\GB[Files] \\ return to "Files" menu
|Download
\BL[SetProtocol] \\ selected protocol stored in %V9
\IV9+Q[\GB[Files]] \\ back to files menu if no protocol
{
Enter name of file to download: `
\RV0[38]{\( \\ read filename into %V0
\II+"\,%V0[\BL[SecondPW]\IV0+CANCEL[\GB[Files]] \\ if there is a "\" in the
\\ filename, then require 2nd password.
\II-"\,%V0[\SV0[%V4%V0]] \\ Otherwise, add host file path to name.
\FE-%V0[File not found.{\GB[Files]] \\ end block if file doesn't exist
{
Sending: %V0{
Protocol: [%V9]{
Start the download on your end now.{\(
\IV9+A[Press <Return> when ready: \WL{] \\ expect <CR> if ASCII download
\UL%V9[%V0]\( \\ send file %V0 using protocol %V9
\IV9+A[^K] \\ send <Ctrl-K> to close ASCII download
{
\IT+[Download successful.|Download unsuccessful.]{
\GB[Files] \\ go back to files menu
|Upload
\BL[SetProtocol] \\ selected protocol stored in %V9
\IV9+Q[\GB[Files]] \\ back to files menu if no protocol
{
Enter name of file to upload: `
\RV0[38]{\( \\ read filename into %V0
\IV0+[\GB[Files]] \\ back to menu if no filename entered
\II+"\,%V0[\BL[SecondPW]`\IV0+CANCEL[\GB[Files]] \\ if there is a "\" in the
\\ filename, then require 2nd password.
\II-"\,%V0[\SV0[%V4%V0]] \\ Otherwise, add host file path to name.
\II-.,%V0[\SV0[%V0.]] \\ Add "." to filename if not there
\FE+%V0[File already exists.{\GB[Files]] \\ go back if file already here
{
Receiving: %V0{
Protocol: [%V9]{
Start the upload on your end now.{\(
\PA[4] \\ wait 4 secs before expecting file
\DL%V9[%V0]\( \\ receive file %V0 using protocol %V9
{
\IT+[Upload successful.|Upload unsuccessful.]{
\GB[Files] \\ go back to files menu
|SetProtocol \\ returns the protocol letter selected, in %V9
{
Protocol Select ([A] ASCII, [X] Xmodem, [C] CRC-Xmodem, [1] 1K-Xmodem,{
[Y] Ymodem, [G] G-Ymodem,
\IP+K[ [K] Kermit,] \\ add Kermit and Zmodem to the menu
\IP+Z[ [Z] Zmodem,] \\ only if they are available
[Q] Quit): ` \\ add "quit" option to menu
\RV9[1]{\( \\ read one character into %V9.
\IV9+Q[\EB] \\ End block if %V9 is a valid
\IV9+A[\EB] \\ selection from the menu.
\IV9+X[\EB]
\IV9+C[\EB]
\IV9+1[\EB]
\IV9+Y[\EB]
\IV9+G[\EB]
\IV9+K[\IP+K[\EB]] \\ check for existence of external
\IV9+Z[\IP+Z[\EB]] \\ protocol before okaying it.
Invalid protocol.{ \\ otherwise report an error, and go
\GB[SetProtocol] \\ back to ask for another protocol.
|SecondPW
Enter secondary password: \RV8[12]\( \\ prompt for secondary password
\IE-%V8,%V2[Wrong password.{\SV0[CANCEL]] \\ sets %V0 to CANCEL if wrong
|Shell
{
\BL[SecondPW] \\ require secondary password
\IV0+CANCEL[\GB[Menu]] \\ if no good, go back to main menu
\UM[| Host user Jumped to DOS.] \\ add usage message to BOYAN.USE
{
\IV3+LOCAL[\JD\GB[Menu]] \\ if Local Host test, just Jump to DOS.
Type "EXIT" to return to BOYAN-Host.{\\ otherwise do the following:
\SV0[%V4`hosttemp.bat] \\ Create a new batch file HOSTTEMP.BAT
\FE+%V0[\DC[del %V0]] \\ which has three lines:
\AF%V0[CTTY COM%MD] \\ CTTY COM1 (or COM2,COM3,COM4)
\AF%V0[COMMAND] \\ COMMAND
\AF%V0[CTTY CON] \\ CTTY CON
\( \\ This shortcut insures carrier detect
\DC[%V4`hosttemp] \\ Then execute the batch file.
\GB[Menu] \\ go back to main menu
|Goodbye
{
Goodbye select ([G]o back, [S]hutdown host, <CR>=hang up): `
\RV0[1]{\(
\IV0+G[\GB[Menu]] \\ If "G", return to main host menu
\IV0-S[\GB[LogOff]] \\ If anything but "S", log them off
\BL[SecondPW] \\ require secondary password to shutdown
\IV0+CANCEL[\GB[Goodbye]] \\ if wrong password, back to above
\GB[ShutDown] \\ Go shut down!
|WrongPassword
\UM[| Incorrect password '%V0'; user denied entrance.]\\ add BOYAN.USE message
\GB[LogOff] \\ User will be hung up.
|LogOff
{
Thank you for using BOYAN host!{ \\ logoff message
\IV3+MODEM[\PA[5]\HU~~~] \\ If MODEM connection, pause & hang up.
\GB[Cycle] \\ Then cycle for next caller.
|Cycle \\ This block automatically runs between all calls.
\IV3+MODEM[\HU\PL] \\ Make sure we've hung up, & purge line
\DM1[-------- BOYAN Host 4.0 --------]
\DM2[ Cycling... ]
\DM3[ Press <Esc> to quit Host Mode. ]
\PA[3] \\ Pause 3 seconds, then...
\DM1,[Host cycled %V6 at %HR:%MI.] \\ Display cycled message on screen.
\SV6[] \\ Erase the username from %V6
\IV3+MODEM[\GB[WaitForCall]] \\ If modem connection, wait for call;
\GB[Welcome] \\ otherwise, go start up host.
|ShutDown
{BOYAN Host shut down.{
\IV3+MODEM[\PA[2]\HU] \\ Pause & hang up.
\PA[2] \\ 2-second pause...
\AB \\ Abort script
|Reset \\ Auto-macro #12 runs this block after HOST is aborted!
\DM1[-------- BOYAN Host 4.0 --------]
\DM2[ Host mode finished. ]
\DM3[Press <Alt-I> to re-invoke host.]
\UM[HOST MODE SHUT DOWN] \\ add usage message to BOYAN.USE
\SM12[%V5] \\ reset macro #12 to what it was before
\SM119[%V7] \\ reset Shortcut \( to what it was "
\IV5+\SC"[HOST;Reset"][\SM12[]] \\ make sure we don't have an endless loop
\BB+ \\ Beeps & Bells back on
\AM[%AP] \\ change back to previous action module
\AB \\ Abort script